<template>
  <div>
<!--    查询from表单-->
    <div>
      <el-form :inline="true" size="mini" style="margin-top: 2%">
        <el-form-item label="讲师名称：">
          <el-input v-model.trim="map.tname"></el-input>
        </el-form-item>
        <el-form-item label="分润状态：" >
          <el-select v-model="map.profitStatus" class="auto-width" clearable filterable placeholder="分润状态" style="width: 100px">
            <el-option
              v-for="item in profitStatusList"
              :key="item.code"
              :label="item.desc"
              :value="item.code">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="时间：">
          <div class="block">
            <el-date-picker
              v-model="map.gmtCreate"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
          </div>
        </el-form-item>
        <el-form-item>
          <el-button icon='el-icon-search' type="primary" @click=handleCheck>查询</el-button>
          <el-button icon='el-icon-refresh' class="filter-item" @click=handleReset>重置</el-button>
        </el-form-item>
      </el-form>
    </div>
<!--    数据表格-->
    <div>
      <el-table :data="tableData" border>
        <el-table-column fixed prop="tid" label="序号"></el-table-column>
        <el-table-column prop="tname" label="讲师名称"></el-table-column>
        <el-table-column prop="tphone" label="讲师手机"></el-table-column>
        <el-table-column prop="cardNumber" width="200" label="银行卡号"></el-table-column>
        <el-table-column prop="bnakName" label="银行名称"></el-table-column>
        <el-table-column prop="accountName" label="开户名"></el-table-column>
        <el-table-column prop="tIncome" label="讲师收入"></el-table-column>
        <el-table-column prop="pIncome" label="平台收入"></el-table-column>
        <el-table-column prop="auditid" label="审核状态">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.auditid === 0" type="brandColor">待审核</el-tag>
            <el-tag v-if="scope.row.auditid === 1" type="success">审核中</el-tag>
            <el-tag v-if="scope.row.auditid === 2" type="danger">审核通过</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="dataTime" label="时间">
        </el-table-column>
        <el-table-column fixed="right" label="操作" align="center">
          <template slot-scope="scope">
                <el-button type="success" @click="handleEdit(scope.row)" size="mini">打款</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>

  </div>
</template>

<script>
export default {
name: "ShareProfit",
  data(){
    return{
      id:[],

      map:{
        tname:'',
        profitStatus:'',
        gmtCreate:'',
      },
      profitStatusList:[
        {
          code:0,
          desc:'未分润'
      },
        {
          code:1,
          desc:'已分润'
        },
      ],
      tableData: [{
        states:'',
        tid: 1,
        tname: '王小虎',
        tphone: '110110110110',
        cardNumber:'1688888888888888888',
        bnakName:'建设银行',
        accountName:'杨洋',
        tIncome:'100',
        pIncome:'20',
        auditid:0,
        dataTime:'',
      }, {
        states:false,
        tid: 2,
        tname: '王大虎',
        tphone: '110110110110',
        cardNumber:'1688888888888888888',
        bnakName:'建设银行',
        accountName:'杨洋',
        tIncome:'100',
        pIncome:'20',
        auditid:0,
        dataTime:'',}]
    }
  },
  methods:{

    //查询按钮
    handleCheck(){
    },
    //重置按钮
    handleReset(){
      this.map.tname='';
      this.map.gmtCreate='';
      this.map.profitStatus=''
    },
    //打款按钮
    handleEdit(obj){
      this.$confirm('确定要给'+obj.tname+'讲师打款吗？',{
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(()=>{
        obj.auditid=1
      }).catch(()=>{
        obj.auditid=2
      })
    },
  },

}
</script>

<style scoped>

</style>
